package sv.gob.mh.dgii.model;

// Generated Dec 12, 2007 1:25:05 PM by Hibernate Tools 3.2.0.CR1

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * DvAcuerdProd generated by hbm2java
 */
@Entity
@Table(name = "DV_ACUERD_PROD", schema = "DEVOLUCIONES")
public class DvAcuerdProd implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -177418205559933156L;
	private DvAcuerdProdId id;
	private TbProdExpor tbProdExpor;
	private DvAcuerdExpor dvAcuerdExpor;

	public DvAcuerdProd() {
	}

	public DvAcuerdProd(DvAcuerdProdId id, TbProdExpor tbProdExpor,
			DvAcuerdExpor dvAcuerdExpor) {
		this.id = id;
		this.tbProdExpor = tbProdExpor;
		this.dvAcuerdExpor = dvAcuerdExpor;
	}

	@EmbeddedId
	@AttributeOverrides( {
			@AttributeOverride(name = "nit", column = @Column(name = "NIT", nullable = false, length = 14)),
			@AttributeOverride(name = "nacuerdoExp", column = @Column(name = "N_ACUERDO_EXP", nullable = false, precision = 5, scale = 0)),
			@AttributeOverride(name = "cproducto", column = @Column(name = "C_PRODUCTO", nullable = false, precision = 5, scale = 0)) })
	public DvAcuerdProdId getId() {
		return this.id;
	}

	public void setId(DvAcuerdProdId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "C_PRODUCTO", nullable = false, insertable = false, updatable = false)
	public TbProdExpor getTbProdExpor() {
		return this.tbProdExpor;
	}

	public void setTbProdExpor(TbProdExpor tbProdExpor) {
		this.tbProdExpor = tbProdExpor;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumns( {
			@JoinColumn(name = "NIT", referencedColumnName = "NIT", nullable = false, insertable = false, updatable = false),
			@JoinColumn(name = "N_ACUERDO_EXP", referencedColumnName = "N_ACUERDO_EXP", nullable = false, insertable = false, updatable = false) })
	public DvAcuerdExpor getDvAcuerdExpor() {
		return this.dvAcuerdExpor;
	}

	public void setDvAcuerdExpor(DvAcuerdExpor dvAcuerdExpor) {
		this.dvAcuerdExpor = dvAcuerdExpor;
	}

}
